<?php
@ob_start();
@session_start();
include("checkSession.php");
error_reporting (E_ALL ^ E_NOTICE);
require_once("../../includes/GPSFunction.php");

//require_once("User.php");

//	DB Connection
require_once("../../includes/config.inc.php"); 
require_once("../../includes/Database.class.php"); 
require_once("../../includes/pagination.php");
$db = new Database(DB_SERVER, DB_USER, DB_PASS, DB_DATABASE); 
$db->connect(); 
//echo $_SERVER['HTTP_HOST'];
include("Util.php"); 
$util =  new Util();

// Get Superadmin Information
$sql = "SELECT * FROM tb_superadmininfo WHERE sai_id  = ".$_SESSION[superID];
$rows = $db->query($sql);

if($db->affected_rows > 0){
	$record = $db->fetch_array($rows);
	//print_r($record);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>GPS Application</title>
<link href="../../images/fav-icon.gif" rel="icon" />
<link href="../../css/style.css" rel="stylesheet" type="text/css" />
<style type="text/css" media="all">@import "../../css/timePicker.css";</style>
<link rel="stylesheet" href="../../css/themes/base/jquery.ui.all.css">

<script src="../../js/ajax.js" type="text/javascript"></script>

<script src="js/jquery-1.4.4.min.js" type="text/javascript"></script>
<script src="../../js/ui/jquery.ui.core.js"></script>
<script src="../../js/ui/jquery.ui.widget.js"></script>
<script src="../../js/ui/jquery.ui.datepicker.js"></script>

<script type="text/javascript" src="../../js/jquery.layout.js"></script>
<script type="text/javascript" src="../../js/timePicker.js"></script>

<script type="text/javascript" src="../../js/highcharts.js"></script>
<script type="text/javascript" src="../../js/modules/exporting.js"></script>
<script src="../../js/gen_validatorv31.js" type="text/javascript"></script>

<script type="text/javascript" src="../../js/pagination.js"></script>

<link rel="stylesheet" type="text/css" href="css/chromestyle2.css" />
<script type="text/javascript" src="js/chrome.js"></script>

<script language="javascript">
function userLogout()
{
	location.href = 'saLogout.php';
}
$(function() {
	$( "#index_date" ).datepicker({
		changeMonth: true,
		changeYear: true,
		maxDate: 0,
		showOn: "button",
		buttonImage: "images/calender.gif",
		buttonImageOnly: true,
		dateFormat : "dd MM yy"
	});
});
</script>
<!-- CSS -->
<style>
</style>

</head>

<body>

<div class="wrapper"><!-- wrapper div START here -->
	<div class="headerarea"><!-- Headerarea div START here -->
    	<div class="toparea"><!-- toparea div start here -->
        	<div class="left"><a href="?ch=home"><img src="../../images/logo.gif" width="145" height="45" /></a></div>
            <div class="right">
                <p><strong>Welcome</strong> : <span class="ui-widget-header"> <?php echo ucfirst($record[sai_firstName]." ".$record[sai_lastName]);?></span> 
                <!--<a class="ui-state-error-text" href="?ch=profile">Profile</a> 
                | <a class="ui-state-error-text" href="?ch=change_pass">Change password</a> -->
                | <a class="ui-state-error-text" href="#" onclick="javascript:userLogout();">Logout</a>
                <span class="">Today : <?php echo date("d F Y, h:i A");?></span><p>
            </div>
        </div><!-- toparea div END here -->
        
        <div class="logo_login_area"><!-- Logo and Login div start here -->
            <div class="menu_place_area" id="chromemenu"><!-- menuarea div end here -->
                <ul class="menu">
                    <li><a href="?ch=home">Home</a></li>                      
                    <li><a href="#" rel="dropmenu1">Account</a></li>
                    <li><a href="#" rel="dropmenu2">Device Status</a></li>
                    <li><a href="?ch=deviceModel">Device Model</a></li>
                </ul>
            <div class="clear"></div>
	        </div><!-- menuarea div end here -->
    
            <!--<div class="search_area">
            	<div class="search_input">
                	<input type="text"class="search_text" /><input type="submit" value="Search" class="search_btn" />
                </div>
            	
        	</div>-->
        </div><!-- Logo and Login div end here -->
        <!--1st drop down menu -->                                                   
        <div id="dropmenu1" class="dropmenudiv">
        	<a href="?ch=viewClient">Client</a>
            <a href="?ch=viewReseller">Reseller</a>
            <!--<a href="?ch=viewSimcard">Sim Card</a>-->
        </div>
		 <div id="dropmenu2" class="dropmenudiv">
        	<a href="?ch=devStatus">Available</a>
            <a href="?ch=showUNDeviceStatus">Unknown</a>
            <!--<a href="?ch=viewSimcard">Sim Card</a>-->
        </div>
        
    </div><!-- headerarea div END here -->
	<div class="pagearea"><!-- pagearea div start here -->
    	
        
         <!--</div>left Panel Div END here -->
        <!-- <div class="ui-layout-center content_panel">CONTENT Panel Div Start here -->
             <div align="center" id="mainAreaInternal">
            <?php			
			  switch($_GET[ch]) 
			  {
			   case 'showUNDeviceStatus':
				   include("showUNDeviceStatus.php");
				  break;
				case 'deviceModel':
				   include("deviceModel.php");
				  break;
			    case 'devStatus':
				   include("showDeviceStatus.php");
				  break;
			  	case 'viewResellerSubscription':
				   include("viewResellerSubscription.php");
				  break;
			  	case 'addResellerSubscription':
				   include("addResellerSubscription.php");
				  break;
			  	case 'Subscription':
				   include("Subscription.php");
				  break;
				case 'Device':
				   include("Device.php");
				  break;
			  	case 'addSubscription':
				   include("addSubscription.php");
				  break;
				case 'viewSubscription':
				   include("viewSubscription.php");
				  break;
				case 'addClientDevice':
				   include("addClientDevice.php");
				  break;
				case 'viewResellClientDevice':
				   include("viewResellClientDevice.php");
				  break;
				case 'viewClientDevice':
				   include("viewClientDevice.php");
				  break;
			  	case 'viewReseller':
				   include("viewReseller.php");
				  break;
			  	case 'addReseller':
				   include("addReseller.php");
				  break;
			  	case 'Reseller':
				   include("Reseller.php");
				  break;
			  	case 'Admin':
				   include("Admin.php");
				  break;
			  	case 'addAdmin':
				   include("addAdmin.php");
				  break;
			  	case 'viewAdmin':
				   include("viewAdmin.php");
				  break;
			  	case 'viewClient':
				   include("viewClient.php");
				  break;
			  	case 'status':
				   include("status.php");
				  break;
			  	case 'Client':
				   include("Client.php");
				  break;
				case 'home':
				  include("viewClient.php");
				  break;
				case 'addClient':
				   include("addClient.php");
				  break;
				default:
				  include("viewClient.php");
				  break;
			  }
			?>
        </div><!-- CONTENT Panel Div END here -->
        <div class="clear"></div>
    </div><!-- Pagearea div end here -->
    
    <div class="clear"></div>
    <div class="footerarea"><!-- footerarea div START here -->
    	<span class="left">&nbsp;</span>
        <span class="right" style="text-align:right;"><!--<a href="#">Link one</a> | <a href="#">Link one</a> | <a href="#">Terms &amp; Conditions</a>--></span>
    </div><!-- Footerarea div END here -->
</div><!-- wrapper div END here -->


<div class="clear"></div>
</body>
</html>
<script type="text/javascript">

cssdropdown.startchrome("chromemenu")

</script>
<?php

$db->close();

?>